<template>
  <div class="error-page">
    <div class="error-content">
      <div class="error-image">
        <img src="/404.svg" alt="404">
      </div>
      <div class="error-info">
        <h1 class="error-code">404</h1>
        <h2 class="error-title">页面不存在</h2>
        <p class="error-description">
          抱歉，您访问的页面不存在或已被删除
        </p>
        <div class="error-actions">
          <el-button type="primary" @click="goHome">返回首页</el-button>
          <el-button @click="goBack">返回上页</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'

const router = useRouter()

const goHome = () => {
  router.push('/')
}

const goBack = () => {
  router.go(-1)
}
</script>

<style lang="scss" scoped>
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.error-content {
  text-align: center;
  max-width: 600px;
  width: 100%;
}

.error-image {
  margin-bottom: 40px;
  
  img {
    max-width: 300px;
    width: 100%;
    height: auto;
  }
}

.error-info {
  color: white;
  
  .error-code {
    font-size: 120px;
    font-weight: bold;
    margin: 0;
    line-height: 1;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }
  
  .error-title {
    font-size: 32px;
    font-weight: 500;
    margin: 20px 0;
    color: rgba(255, 255, 255, 0.9);
  }
  
  .error-description {
    font-size: 16px;
    margin: 20px 0 40px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
  }
}

.error-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

// 响应式设计
@media (max-width: 768px) {
  .error-content {
    .error-code {
      font-size: 80px;
    }
    
    .error-title {
      font-size: 24px;
    }
    
    .error-description {
      font-size: 14px;
    }
  }
  
  .error-actions {
    flex-direction: column;
    align-items: center;
    
    .el-button {
      width: 200px;
    }
  }
}
</style>
